/**
 * @Description
 * @Author
 * @Date 2021/7/19 15:12
 **/
package controller

import (
	"github.com/gin-gonic/gin"
	"goskeleton/app/sqlr/db"
	"goskeleton/app/sqlr/model"
)

type Run struct {
	
}

func NewRun() *Run {
	return &Run{}
}
func (this *Run)Main(c *gin.Context)  {
	//定义参数
	var input db.Parms
	//获取传参
	c.ShouldBindJSON(&input)
	//生成数据
	TlistVAR:=model.NewMainModel().SendListRun(input)
	//清理表
	model.NewMainModel().ClearRun("MzInvoice.Tmplist")
	//插入临时表数据
	model.NewMainModel().CreatedTmp(TlistVAR)
	//汇总计算
	ConRunVAR:=model.NewMainModel().Runt()
	c.JSON(200,gin.H{"count":len(ConRunVAR),"data":ConRunVAR})
}